import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
			networkShow:false,
			gameNetworkShow:false,
			audioCode:uni.createInnerAudioContext(),
			audioCodeDelayed:0,
			arrPath:[]
		},
    mutations: {
			switch(state,code=false){
				this.state.networkShow=code
			},
			setAudioCodeDelayed(state,code=0){
				this.state.audioCodeDelayed=code
			},
			switchGame(state,code=false){
				let time=0
				if(!code) time=1000
				setTimeout(()=>{
					this.state.gameNetworkShow=code
				},time)
				
			},
			setArrPath(state,code=[]){
				this.state.arrPath=code
			}
		},
    actions: {}
})
export default store